<?php

namespace App\Services\Api;

/**
 * 公司认证
 */
class YH20001
{
    public $apiCode = 'YH#20001';

    public function getInitPostData($postData)
    {
        if ($postData['type'] == 2) {
            return [
                'custId' => $postData['custId'],
                'phone' => $postData['phone'],
                'name' => $postData['name'],
                'type' => 2,
                'logo' => $postData['logo'],
                'nature' => $postData['nature'],
                'legalPerson' => $postData['legalPerson'],
                'legalPhone' => $postData['legalPhone'],
                'legalEmail' => $postData['legalEmail'],
                'registerTime' => $postData['registerTime'],
                'registerCapital' => $postData['registerCapital'],
                'registerAddr' => $postData['registerAddr'],
                'postCode' => $postData['postCode'],
                // 'creditRank' => -1,
                // 'totalCapital' => '{}',
                // 'netCapital' => '{}',

                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'fixphone' => $postData['fixphone'],
                'fax' => $postData['fax'],
                'email' => $postData['email'],
                'contactAddr' => $postData['contactAddr'],
                // 'domain' => '',
                // 'serviceMode' => -1,
                // 'wokerNum' => -1,
                // 'techNum' => -1,
                // 'business' => '',
                // 'serviceDomain' => '',
                // 'method' => '',

                'organizationCode' => $postData['organizationCode'],
                'code' => $postData['code'],
                'businessLicene' => $postData['businessLicene'],
                'licene' => $postData['licene'],
                // 'banner' => '{}',
                // 'qual' => '{}',
                // 'gxbAttach' => '{}',
                // 'fgwAttach' => '{}',
                // 'provinceAttach' => '{}',
                // 'cityAttach' => '{}',
                'belongField' => $postData['belongField'],
                'introduction' => $postData['introduction'],
                // 'techExpertise' => '',
                // 'advTitle' => '',
                // 'advContent' => '',
            ];
        } else if ($postData['type'] == 1) {
            if (isset($postData['from_front'])) {
                return [
                    'custId' => $postData['custId'],

                    'phone' => $postData['phone'],
                    'name' => $postData['name'],
                    'type' => 1,
                    'registerAddr' => $postData['registerAddr'],
                    'domain' => $postData['domain'],
                    'licene' => $postData['licene'],
                    'organizationCode' => $postData['organizationCode'],
                    'code' => $postData['code'],
                    'serviceAbility' => $postData['serviceAbility'],
                    'legalPerson' => $postData['legalPerson'],
                ];
            } else {
                return [
                    'custId' => $postData['custId'],
                    'serviceAbility' => [],

                    'phone' => $postData['phone'],
                    'name' => $postData['name'],
                    'type' => 1,
                    'nature' => $postData['nature'],

                    'logo' => $postData['logo'],
                    'legalPerson' => $postData['legalPerson'],
                    'legalPhone' => $postData['legalPhone'],
                    'legalEmail' => $postData['legalEmail'],
                    'registerTime' => $postData['registerTime'],
                    'registerCapital' => $postData['registerCapital'],
                    'registerAddr' => $postData['registerAddr'],
                    'postCode' => $postData['postCode'],

                    'creditRank' => $postData['creditRank'],

                    'totalCapital' => $postData['totalCapital'],
                    'netCapital' => $postData['netCapital'],

                    'contact' => $postData['contact'],
                    'telephone' => $postData['telephone'],
                    'fixphone' => $postData['fixphone'],
                    'fax' => $postData['fax'],
                    'email' => $postData['email'],
                    'contactAddr' => $postData['contactAddr'],

                    'domain' => $postData['domain'],
                    'serviceMode' => $postData['serviceMode'],
                    'workerNum' => $postData['workerNum'],
                    'techNum' => $postData['techNum'],
                    'business' => $postData['business'],
                    'serviceDomain' => $postData['serviceDomain'],
                    'method' => $postData['method'],
                    'organizationCode' => $postData['organizationCode'],
                    'code' => $postData['code'],
                    'businessLicene' => $postData['businessLicene'],
                    'licene' => $postData['licene'],
                    'banner' => $postData['banner'],
                    'qual' => $postData['qual'],
                    'gxbAttach' => $postData['gxbAttach'],
                    'fgwAttach' => $postData['fgwAttach'],
                    'provinceAttach' => $postData['provinceAttach'],
                    'cityAttach' => $postData['cityAttach'],
                    'introduction' => $postData['introduction'],
                    'techExpertise' => $postData['techExpertise'],
                    'advContent' => $postData['advContent'],
                ];

            }

        }

    }

    public function getInitApiCode()
    {
        return $this->apiCode;
    }

}
